package com.hwy.catering.controller;

import com.hwy.catering.entity.FlavorDetail;
import com.hwy.catering.service.FlavorDetailService;
import com.hwy.catering.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "具体口味接口")
@RestController
@RequestMapping("/cater/flavorDetail")
public class FlavorDetailController {

    @Resource
    private FlavorDetailService flavorDetailService;

    @ApiOperation("新增具体口味")
    @PostMapping("/addFlavorDetail")
    public R addFlavorDetail(@RequestBody FlavorDetail flavorDetail){
        R r = flavorDetailService.addFlavorDetail(flavorDetail);
        return r;
    }

    @ApiOperation("查询口味具体信息")
    @PostMapping("/findFlavorDetail")
    public R findFlavorDetail(@RequestBody List<String> idList){
        R r = flavorDetailService.findFlavorDetail(idList);
        return r;
    }

    @ApiOperation("删除具体口味")
    @PostMapping("/deletedFlavorDetail/{id}")
    public R deletedFlavorDetail(@PathVariable Long id){
        R r = flavorDetailService.deletedFlavorDetail(id);
        return r;
    }
}
